package mornd.tomcat.test1;

import org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext;
import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping;

/**
 * @author: mornd
 * @dateTime: 2023/5/9 - 14:59
 * 使用 tomcat 来处理错误请求
 */
public class App {
    public static void main(String[] args) {
        AnnotationConfigServletWebServerApplicationContext context =
                new AnnotationConfigServletWebServerApplicationContext(WebConfig.class);

        RequestMappingHandlerMapping handlerMapping = context.getBean(RequestMappingHandlerMapping.class);
        System.out.println("RequestMappingInfo : HandlerMethod");
        handlerMapping.getHandlerMethods().forEach((k, v) -> {
            System.out.println(k + " : " + v);
        });

    }
}
